﻿namespace OboutInc.ImageZoom
{
    using System.Collections.Generic;

    public class ListAdapterBuilder : AdapterBuilder
    {
        private ListAdapter _adapter;

        public override IDataSourceAdapter Adapter
        {
            get
            {
                return this.ViewAdapter;
            }
        }

        private ListAdapter ViewAdapter
        {
            get
            {
                if (this._adapter == null)
                {
                    List<string> source = (List<string>) this.Source;
                    this._adapter = new ListAdapter(source);
                }
                return this._adapter;
            }
        }
    }
}

